import {defineStore} from 'pinia'

export const personPinia = defineStore(
    {
        id:'personPinia',
        state:()=>{
            return{
                username:'zhangsan',
                age:10,
                hobbies:['吃饭','唱歌']
            }
        },
        getters:{
            getAge(){
                return this.get
            },
            getHobbiesCount(){
                return this.hobbies.length
            }
        },
        actions:{
            doubleAge(){
                this.age = this.age*2
            }
        }
    }
)